<!doctype html>
<html lang="zh-CH">
<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<title>央票通商品列表</title>
	<link rel="stylesheet" href="./resource/css/ypt_index.css">
	<link rel="stylesheet" href="./resource/css/ypt_s_product.css">
</head>
<body>
<!-- 顶部 -->
@include('common.shop_index_head')
<!-- cont -->
<div class="shop-list main">
	<div class="search-ul">
		{{--<a href="/ypt_shop_list" class="active">默认排序</a>--}}
		@if(!empty($sort))
			<a href="/ypt_shop_list?c_id={{$sort}}&stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" class="active">默认排序</a>
		@else
			@if(empty($keywords))
				@if(empty($stock)&&empty($mix_price)&empty($max_price)))
					<a href="/ypt_shop_list" class="active">默认排序</a>
				@else
					<a href="/ypt_shop_list?stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" class="active">默认排序</a>
				@endif
			@else
				<a href="/ypt_shop_list?keywords={{$keywords}}&stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" class="active">默认排序</a>
			@endif
		@endif
		@if(!empty($sort))
			<a href="/ypt_shop_list?c_id={{$sort}}&id=p_up&stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" rel="price" dis="show">价格<i rel="top"></i></a>
			<a href="/ypt_shop_list?c_id={{$sort}}&id=p_down&stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" rel="price" dis="show">价格<i rel="bot"></i></a>
		@else
			@if(empty($keywords))
				<a href="/ypt_shop_list?id=p_up&stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" rel="price" dis="show">价格<i rel="top"></i></a>
				<a href="/ypt_shop_list?id=p_down&stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" rel="price" dis="show">价格<i rel="bot"></i></a>
			@else
				<a href="/ypt_shop_list?keywords={{$keywords}}&id=p_up&stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" rel="price" dis="show">价格<i rel="top"></i></a>
				<a href="/ypt_shop_list?keywords={{$keywords}}&id=p_down&stock={{$stock}}&mix_price={{$mix_price}}&max_price={{$max_price}}" rel="price" dis="show">价格<i rel="bot"></i></a>
			@endif
		@endif
		@if(!empty($sort))
			@if(!empty($id))
				<form action="/ypt_shop_list?c_id={{$sort}}&&id={{$id}}" method="post" >
			@else
				<form action="/ypt_shop_list?c_id={{$sort}}" method="post" >
			@endif
		@else
			@if(!empty($keywords))
				@if(!empty($id))
					<form action="/ypt_shop_list?keywords={{$keywords}}&&id={{$id}}" method="post" >
				@else
					<form action="/ypt_shop_list?keywords={{$keywords}}" method="post" >
				@endif
			@else
				@if(!empty($id))
					<form action="/ypt_shop_list?id={{$id}}" method="post" >
				@else
					<form action="/ypt_shop_list" method="post" >
				@endif
			@endif
		@endif
		<div class="box left">
			@if(empty($mix_price))
				<input type="text" class="num-mon" placeholder="最低价" name="mix_price" >
			@else
				<input type="text" class="num-mon" placeholder="最低价" name="mix_price" value="{{$mix_price}}">
			@endif
			<span class="line"></span>
			@if(empty($max_price))
				<input type="text" class="num-mon" placeholder="最高价" name="max_price" >
			@else
				<input type="text" class="num-mon" placeholder="最高价" name="max_price" value="{{$max_price}}">
			@endif
		</div>
		<div class="box left">
			<span class="t">起定量</span>
			@if(empty($stock))
				<input type="text" class="star-num" name="stock">
				@else
				<input type="text" class="star-num" name="stock" value="{{$stock}}">
			@endif
		</div>
		</form>
	</div>
	<div class="list-shop">
		<ul>
			{{--<li class="shop-li">--}}
				{{--<div class="shop-img">--}}
					{{--<a href="javascript:;"><img src="./resource/img/floor_shop_11.jpg" alt=""></a>--}}
				{{--</div>--}}
				{{--<div class="shop-info">--}}
					{{--<a href="javascript:;" class="name"><span>樟子松</span></a>--}}
					{{--<span class="money">￥900.00/立方米</span>--}}
					{{--<a href="javascript:;" class="company">中国工艺有限公司</a>--}}
				{{--</div>--}}
			{{--</li>--}}
			@foreach($info as $k=>$v)
				<li class="shop-li">
					<div class="shop-img">
						<a href="/ypt_shop_details?product_id={{$v->product_id}}"><img src={{$v->img1}} alt=""></a>
					</div>
					<div class="shop-info">
						<a href="/ypt_shop_details?product_id={{$v->product_id}}" class="name"><span>{{$v->product_name}}</span></a>
						<span class="money">￥{{$v->price}}</span>
						<a href="/ypt_business_shop_list?business_id={{$v->business_id}}" class="company">{{$v->business_name}}</a>
					</div>
				</li>
			@endforeach
			@if(!empty($sort))
				@if(!empty($id))
					{{$info->appends(['id' => $id,'c_id'=>$sort,'stock'=>$stock,'mix_price'=>$mix_price,'max_price'=>$max_price])->links()}}
				@else
					{{$info->appends(['c_id'=>$sort,'stock'=>$stock,'mix_price'=>$mix_price,'max_price'=>$max_price])->links()}}
				@endif
			@else
				@if(empty($keywords))
					@if(empty($id)&&empty($stock)&&empty($mix_price)&&empty($max_price))
						{{$info->links()}}
					@else
						{{$info->appends(['id' => $id,'stock'=>$stock,'mix_price'=>$mix_price,'max_price'=>$max_price])->links()}}
					@endif
				@else
					@if(empty($id))
						{{$info->appends(['keywords' => $keywords,'stock'=>$stock,'mix_price'=>$mix_price,'max_price'=>$max_price])->links()}}
					@else
						{{$info->appends(['keywords' => $keywords,'id' => $id,'stock'=>$stock,'mix_price'=>$mix_price,'max_price'=>$max_price])->links()}}
					@endif
				@endif
			@endif
			{{--{{$info->appends(['id' => $search])->render()}}--}}
			{{--{{$info->links()}}--}}
			{{--@for($i=0;$i<20;$i++)--}}
			{{--<li class="shop-li">--}}
				{{--<div class="shop-img">--}}
					{{--<a href="/ypt_shop_details"><img src="./resource/img/floor_shop_11.jpg" alt=""></a>--}}
				{{--</div>--}}
				{{--<div class="shop-info">--}}
					{{--<a href="/ypt_shop_details" class="name"><span>樟子松</span></a>--}}
					{{--<span class="money">￥900.00/立方米</span>--}}
					{{--<a href="/ypt_business_shop_list" class="company">中国工艺有限公司</a>--}}
				{{--</div>--}}
			{{--</li>--}}
			{{--@endfor--}}
		</ul>
	</div>
</div>
<!-- 底部 -->
<div class="foot">
	<div class="main">
		<div class="left">
			<div class="foot-nav">
				<dl>
				    <dt><span>关于央票通</span></dt>
				    <dd>
				    	<a href="javascript:;" target="_blank">公司简介</a> 
				    	<a href="javascript:;" target="_blank">团队介绍</a>
				    	<a href="javascript:;" target="_blank">加入我们</a>
				    	<a href="javascript:;" target="_blank">联系我们</a>
				    </dd>
				</dl>
				<dl>
				    <dt><span>新手上路</span></dt>
				    <dd>
				    	<a href="javascript:;" target="_blank">新手专区</a> 
				    	<a href="javascript:;" target="_blank">交易安全</a>
				    	<a href="javascript:;" target="_blank">24小时在线帮助</a>
				    	<a href="javascript:;" target="_blank">免费开店</a>
				    </dd>
				</dl>
				<dl>
				    <dt><span>配送方式</span></dt>
				    <dd>
				    	<a href="javascript:;" target="_blank">货到付款</a> 
				    </dd>
				</dl>
				<dl>
				    <dt><span>售后服务与保障</span></dt>
				    <dd>
				    	<a href="javascript:;" target="_blank">保障范围</a> 
				    	<a href="javascript:;" target="_blank">退货退款流程</a>
				    	<a href="javascript:;" target="_blank">服务中心</a>
				    </dd>
				</dl>
				<dl>
				    <dt><span>联系方式</span></dt>
				    <dd>
				    	<a href="javascript:;" target="_blank">400-0678-797</a> 
				    </dd>
				</dl>
			</div>
			<div class="foot-info">
				<p>中企汇（北京）有限公司 京ICP备15043001   Copyright © 2016  yangpiaotong.com 版权所有</p>
			</div>
		</div>
		<div class="foot-code right">
			<img src="./resource/img/foot_code.png" alt="">
		</div>
	</div>
</div>
<script src="./resource/js/jquery-1.11.3.min.js"></script>
<script src="./resource/js/ypt_index.js"></script>
<script>
	//导航 商品全部 隐藏显示
	var $allW = $('.all-wrap');
    $allW.hide();
    $('.nav .nav-all').attr('rel','hide');
    $('.nav .nav-all').click(function(){
        if($(this).attr('rel') == 'hide'){
            $(this).attr('rel','show');
            $allW.show();
        }else{
            $(this).attr('rel','hide');
            $allW.hide();
        };
    });
	//
	function GetQueryString(name)
	{
		var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
		var r = window.location.search.substr(1).match(reg);
		if(r!=null)return  unescape(r[2]); return null;
	}
	var myurl=GetQueryString("id");
	if(myurl !=null && myurl.toString().length>1)
	{
		if(GetQueryString("id") == 'p_down'){
			$('.search-ul a').removeClass('active');
			$('.search-ul a[rel="price"]').eq(1).addClass('active');
		}else if(GetQueryString("id") == 'p_up'){
			$('.search-ul a').removeClass('active');
			$('.search-ul a[rel="price"]').eq(0).addClass('active');
		};
	}

</script>		
</body>
</html>